package com.lb.activity.mapper;

import com.lb.activity.po.Role;
import org.apache.ibatis.annotations.Select;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;

public interface RoleMapper extends Mapper<Role> {

    /**
     * 根据用户id 查询用户角色
     * @param userId
     * @return
     */
    @Select(" select r.id from role r,user_role ur where r.id = ur.roleid and r.status = 0 and ur.userid = #{userId} ")
    List<Long> selectRoleByUserId(Long userId);
}
